<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<title>系统管理-角色管理</title>
		<jsp:include page="../../include/base.jsp"></jsp:include>
		<jsp:include page="../../include/common.jsp"></jsp:include>
		<script src="../MainHandler.js" type="text/javascript"></script>
		<script src="rolePanel.js" type="text/javascript"></script>

		<style type="text/css">
body {
	margin: 0;
	padding: 0;
	border: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}

<!--
用于修正miniUI的分页条信息不显示的BUG  -->
#rolePager .mini-pager-left {position: absolute;top: 0;left: 0;}
#rolePager .mini-pager-right {position: absolute;top: 0;right: 0;}
#roleUserPager .mini-pager-left {position: absolute;top: 0;left: 0;}
#roleUserPager .mini-pager-right {position: absolute;top: 0;right: 0;}
</style>

	</head>

	<body>
			 <div class="mini-layout" splitSize="2" style="width:100%; height:100%;">
			 <div region="north" height="32px" showHeader="false" allowResize="true" >
			 	<div class="mini-toolbar" style="border:0;font-size:12px;padding-left:6px;">
		            <a id="system_role_add" class="mini-button" iconCls="icon-addnew" plain="false" visible="false" onclick="RolePanel.add">新增角色</a>
		            <a id="system_role_edit" class="mini-button" iconCls="icon-edit" plain="false" visible="false" onclick="RolePanel.edit">编辑角色</a>
		            <a id="system_role_del" class="mini-button" iconCls="icon-remove" plain="false" visible="false" onclick="RolePanel.del">删除角色</a>
		            <a id="system_role_author" class="mini-button" iconCls="app-btn-tool" plain="false" visible="false" onclick="RolePanel.authorized">角色授权</a>
		            <a id="system_role_bund" class="mini-button" iconCls="icon-btn-gguanlian" plain="false" visible="false" onclick="RolePanel.showUserSet">绑定用户</a>
		            <span class="separator"></span>
		            <a id="system_role_reload" class="mini-button" iconCls="icon-btn-refresh" plain="false" visible="false" onclick="RolePanel.reload">刷新</a>
				</div>
			 </div>
		 	<div region="west" showHeader="false" allowResize="true" width="700px" maxWidth="760px" 
		 		minWidth="500px;" style="border-bottom:0;">
				<div class="mini-fit">
						<div id="roleDatagrid" class="mini-datagrid" fitColumns="true" multiSelect="false"
							showFooter="false" idField="roleId" onselectionchanged="RolePanel.loadRoleUser"
							style="width: 100%; height: 100%;" borderStyle="border:0;">
							<div property="columns">
								<div type="checkcolumn"></div>
									<div type="indexcolumn" width="40" headerAlign="center">
										序号
									</div>
									<div field="name" width="120" headerAlign="center" allowSort="true">
										名称
									</div>
									<div field="code" width="140" headerAlign="center" allowSort="true">
										编码
									</div>
									<div field="type" width="80" align="center" headerAlign="center">
										类型
									</div>
									<div field="remark" width="100%" allowSort="true"
										headerAlign="center">
										备注
									</div>
									<div field="glText" width="120" allowSort="true" align="center"
										headerAlign="center">
										管理
									</div>
								</div>
						</div>
				</div>
				<div class="mini-pager" id="rolePager" style="border: solid 1px #ccc;"
					onpagechanged="RolePanel.pagechanged" sizeList="[5,10,20]">
				</div>
		 	</div>
	 		<div region="center" style="border:0;">
					<div id="roleUserDatagrid" class="mini-datagrid" fitColumns="true" multiSelect="true"
						showFooter="false" idField="userId" style="width: 100%; height: 100%; "
						borderStyle="border-right:0; border-bottom:0;">
						<div property="columns">
							<div type="checkcolumn" width="40"></div>
							<div field="nickName" width="120" headerAlign="center" allowSort="true">
								角色下用户
							</div>
							<div field="uname" width="120" headerAlign="center" allowSort="true">
								登录名
							</div>
							<div field="remark" width="100%" allowSort="true" headerAlign="center">
								备注
							</div>
						</div>
					</div>
	 		</div>
		 	</div>

		<div id="roleEditWindow" class="mini-window" title="管理角色"
			style="width: 400px;" showModal="true" allowResize="false"
			allowDrag="true">
			<div id="roleEditform" class="form">
				<input class="mini-hidden" name="roleId" />
				<table style="width: 100%;">
					<tr>
						<td style="width: 100px;" align="right">
							名称：
						</td>
						<td style="width: 200px;" align="center">
							<input name="name" class="mini-textbox" required="true"
								style="width: 150px" />
						</td>
						<td style="color: red;">
							必填
						</td>
					</tr>
					<tr>
						<td style="width: 100px;" align="right">
							编码：
						</td>
						<td style="width: 200px;" align="center">
							<input name="code" class="mini-textbox" required="true"
								style="width: 150px" />
						</td>
						<td style="color: red;">
							必填
						</td>
					</tr>
					<tr>
						<td style="width: 100px;" align="right">
							备注：
						</td>
						<td style="width: 200px;" align="center">
							<input name="remark" class="mini-textbox" style="width: 150px" />
						</td>
					</tr>
					<tr>
						<td
							style="text-align: center; padding-top: 5px; padding-right: 20px;"
							colspan="6">
							<a class="mini-button " plain="true" iconCls="icon-add"
								onclick="RolePanel.save">保存</a>
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<a class="mini-button" plain="true" iconCls="icon-remove"
								onclick="RolePanel.closeButton">关闭</a>
						</td>
					</tr>
				</table>
			</div>
		</div>

		<div id="roleRoleEditWindow" class="mini-window" title="角色授权"
			style="width: 430px;" showModal="true" allowResize="false"
			allowDrag="true">
			<span>
			<div id="roleTreegrid" class="mini-treegrid"
				style="width: 380px; height: 350px; padding-left: 15px;"
				showTreeIcon="true" treeColumn="name" idField="funId"
				parentField="pfunId" showCheckBox="true" resultAsTree="false"
				iconField="funIcon" checkRecursive="true" autoCheckParent="true">
				<div property="columns">
					<div name="name" field="name" headerAlign="center" width="200">
						已授权功能
					</div>
					<div field="funCode" headerAlign="center" width="130">
						功能编码
					</div>
				</div>
			</div>
			</span>
			<br />
			<center>
				<span style="color: red">注：选中项表示已经授权，请为角色勾选需要授予的功能权限！</span>
			</center>
			<br />
			<center>
				<span> <a class="mini-button " plain="true"
					iconCls="icon-add" onclick="RolePanel.savePurview">保存</a>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a
					class="mini-button" plain="true" iconCls="icon-remove"
					onclick="RolePanel.closeRoButton">关闭</a>
			</center>
			<br />
		</div>

		<div id="roleRoleUserEditWindow" class="mini-window" title="设置角色用户"
			style="width: 700px; height: 500px" showModal="true"
			allowResize="false" allowDrag="true">
			<table style="width: 100%;">
				<tr>
					<td style="height: 420px" align="left">
						<div class="mini-fit">

							<div id="roleUserWinDatagrid" class="mini-datagrid"
								style="width: 100%;" idField="userId" fitColumns="true"
								multiSelect="true" showFooter="false">
								<div property="columns">
									<div type="checkcolumn"></div>
									<div type="indexcolumn" width="50" headerAlign="center">
										序号
									</div>
									<div field="nickName" width="100" align="center"
										headerAlign="center" allowSort="true">
										姓名
									</div>
									<div field="uname" width="100" align="center"
										headerAlign="center" allowSort="true">
										登录名
									</div>
									<div field="ucode" width="100" align="center"
										headerAlign="center">
										编码
									</div>
									<div field="phone" width="100" align="center" allowSort="true"
										headerAlign="center">
										手机
									</div>
									<div field="remark" width="100%" align="center"
										allowSort="true" headerAlign="center">
										备注
									</div>
								</div>
							</div>
						</div>
						<div class="mini-pager" id="roleUserPager"
							style="border: solid 1px #ccc;" onpagechanged="RolePanel.userPagechanged"
							sizeList="[5,10,20]">
						</div>
					</td>
				</tr>
				<tr>
					<td
						style="text-align: center; padding-top: 5px; padding-right: 20px;"
						colspan="6">
						<a class="mini-button " plain="true" iconCls="icon-add"
							onclick="RolePanel.saveRoleUser">确定</a>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<a class="mini-button" plain="true" iconCls="icon-remove"
							onclick="RolePanel.closeRoleUserButton">关闭</a>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					</td>
				</tr>
			</table>
		</div>


	</body>
			<script type="text/javascript">
	mini.parse();
	RolePanel.init();
</script>
</html>
